package com.framework.boc.statistics.entity;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 统计记录表
 * </p>
 *
 * @author Leil
 * @since 2020-12-23
 */
@TableName("CS_STATISTICAL_RECORD")
@KeySequence(value = "SEQ_STATISTICAL_RECORD", clazz = Integer.class)
@ApiModel(value="StatisticalRecord对象", description="统计记录表")
public class StatisticalRecord implements Serializable {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "ID", type = IdType.INPUT)
    private Integer id;

    @ApiModelProperty(value = "批次ID")
    @TableField("BATCH_ID")
    private Integer batchId;

    @ApiModelProperty(value = "模板ID")
    @TableField("TEMPLATE_ID")
    private Integer templateId;

    @ApiModelProperty(value = "记录json字符串")
    @TableField("JSON_TEXT")
    @JsonIgnoreProperties(ignoreUnknown = true)
    private String jsonText;

    @TableField(exist = false)
    private JSONObject jsonTextObj;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getBatchId() {
        return batchId;
    }

    public void setBatchId(Integer batchId) {
        this.batchId = batchId;
    }

    public Integer getTemplateId() {
        return templateId;
    }

    public void setTemplateId(Integer templateId) {
        this.templateId = templateId;
    }

    public String getJsonText() {
        return jsonText;
    }

    public void setJsonText(String jsonText) {
        this.jsonText = jsonText;
    }

    public JSONObject getJsonTextObj() {
        return jsonTextObj;
    }

    public void setJsonTextObj(JSONObject jsonTextObj) {
        this.jsonTextObj = jsonTextObj;
        this.setJsonText(jsonTextObj.toJSONString());
    }

    @Override
    public String toString() {
        return "StatisticalRecord{" +
        "id=" + id +
        ", batchId=" + batchId +
        ", templateId=" + templateId +
        ", jsonText=" + jsonText +
        "}";
    }
}
